package com.itany.service;

import com.github.pagehelper.PageInfo;
import com.itany.exception.BookDisabledException;
import com.itany.exception.FileUploadErrorException;
import com.itany.exception.RequestParamsException;
import com.itany.pojo.Book;
import com.itany.pojo.BookSupplier;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpSession;
import java.util.List;

public interface BookService {

    /**
     * 在线获取图书信息
     */
    Book getBooksinfoOnline(String ISBN) throws RequestParamsException;

    /**
     * 供应商添加图入库业务
     */
    void addBook(String bookname, String ISBN, String price, String number, String groupprice, String layout, String register, String weight, String bookintroduce,
                 String authorintroduce, MultipartFile file, HttpSession session) throws RequestParamsException,
            BookDisabledException, FileUploadErrorException;


    /**
     * 修改图书部分信息业务
     */
    void modifyBook(String bookid,String bookname, String price,  String groupprice, String bookintroduce, String authorintroduce, MultipartFile file  ) throws RequestParamsException, FileUploadErrorException;


    /**
     * 展示所有入库图书
     */
    PageInfo<Book> findAllBooks(Integer page, Integer rows,String booknameKey, String ISBNKey, String supplierId,String pressId);

    /**
     * 修改指定图书状态
     * @param id 图书id
     * @param status 更新后的状态
     */
    void modifyStatus(String id,Integer status) throws RequestParamsException;

    /**
     * 展示指定登录供货商入库图书
     */
    PageInfo<BookSupplier> findBooksBySupplier(Integer page, Integer rows, HttpSession session,String booknameKey, String ISBNKey);
}
